package ics.zychen.sql;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.util.Log;

public class RenrenSqliteHelper extends ASqliteHelper{

    public static final String RENREN_TB_NAME="renren_users";

    public RenrenSqliteHelper(Context context, String name, CursorFactory factory, int version) {

        super(context, name, factory, version);

    }


    //更新表

	@Override

    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

        db.execSQL("DROP TABLE IF EXISTS " + RENREN_TB_NAME);

        onCreate(db);

        Log.e("Database","onUpgrade");

        
    }

    //更新列

    public void updateColumn(SQLiteDatabase db, String oldColumn, String newColumn, String typeColumn){

        try{

            db.execSQL("ALTER TABLE " +

					RENREN_TB_NAME + " CHANGE " +

                    oldColumn + " "+ newColumn +

                    " " + typeColumn

            );

        }catch(Exception e){

            e.printStackTrace();

        }

    }


}
